import {view, binder, View} from "adajs";
import ImageService from "./state.js";
import User from "./../../../lib/user";

@view({
    className: "noticelist",
    template: "./template.html",
    style: "./style.scss",
    dataset: {
        service: ImageService
    }
})
class Image extends View {
    @binder("openNews")
    openNews({item}) {
        this.dispatchEvent("gotoPage", `/${User.isAdmin() ? 'admin' : 'my'}/notice/detail?id=${item.id}`);
    }
}

export default Image;